package com.hfh.io.exer;

import org.junit.Test;

import java.io.*;

public class Exer1 {
    @Test
    public void test(){
        try(Reader reader = new FileReader("file\\a.txt");
            Writer writer = new FileWriter("file\\b.txt")) {
            char[] arr = new char[1024];
            int len;
            while ((len=reader.read(arr))!=-1){
//                System.out.println(new String(arr, 0, len));
                writer.write(arr,0,len);
                writer.flush();
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
